//var file_id = $.query.get('file_id');
//var target_id= $.query.get('target_id');
var multiple=$.query.get('multiple');
var file_group_id=$.query.get('file_group_id');
var edidImageOptions={
		page_id:67,
		singleSelect:multiple==1?false:true,
		grid_id:"editImageGrid",
		isToolbar:"yes",//没有搜索框
		sqlname:"select_file_item_by_groupid",//grid_sys_pub_file_item
		gridParam:{file_group_id:file_group_id}
};
grid2=new uniontrip.datagrid.searchEdit(edidImageOptions);
//document ready
$(function(){
	$('#searchButton').bind('click',grid2.load);//查询操作绑定事件
	$('#removeImageButton').bind('click', grid2.remove);
	$('#saveButton').bind('click', grid2.accept);//保存datagrid绑定事件
	$('#rejectButton').bind('click', grid2.rejectChanges);//撤销编辑绑定事件
	$('#affirmButton').bind('click', affirmButton);
});
//确认选择图片
function affirmButton(){
	var selectRows=grid2.grid.datagrid('getSelections');
	if(selectRows.length>0){
		$.each(selectRows,function(i,v){
			v.item_id=v.id;
		});
		parent.uploaded(selectRows);
	}else{
		$.messager.alert("提示", "请至少选择一条数据！");
	}
}
